package com.salesmanager.core.business.customer.dao;

import com.salesmanager.core.business.customer.model.Customer;
import com.salesmanager.core.business.customer.model.CustomerAuths;
import com.salesmanager.core.business.customer.model.CustomerCriteria;
import com.salesmanager.core.business.generic.dao.SalesManagerEntityDao;
import com.salesmanager.core.business.generic.exception.ServiceException;
import com.salesmanager.core.business.statistics.model.CustomerStatisticsCriteria;
import com.salesmanager.core.business.statistics.model.StatisticsEntityForCustomer;
import com.salesmanager.web.model.paging.PaginationDataList;

import java.text.ParseException;
import java.util.List;


public interface CustomerDAO extends SalesManagerEntityDao<Long, Customer> {

    /**
     *
     * @param username
     * @param deviceToke
     * @param appKey
     * @return
     */
	boolean saveDeviceToke(String username, String deviceToke,String appKey);

    /**
     *
     * @param telphone
     * @return
     */
	Customer getByTelphone(String telphone);

    /**
     *
     * @param id
     * @return
     */
	Customer getCustomer(Long id);


    /**
     *
     * @param criteria
     * @return
     * @throws ServiceException
     */
	PaginationDataList<StatisticsEntityForCustomer> listWithCustomer(CustomerStatisticsCriteria criteria) throws ServiceException;



    /**
     *
     * @param startTime
     * @param endTime
     * @return
     */
    int getCustomerCount(String startTime,String endTime) throws ParseException;

    /**
     * 根据账号类型获取账号
     * @param customerCriteria
     * @return
     */
    CustomerAuths getCustomerAuthByAuthType(CustomerCriteria customerCriteria);

}
